<!-- 教员-安排考试(调整监考) -->
<template>
  <div class="assessment-container" >
    <div class="search-container" style="margin:0;padding:0">
      <div class="search-container-left">
        <div class="search-container-item">
          <span>学期：</span>
          <el-select
            v-model="xq"
            style="width: 90px"
            size="mini"
            clearable
            placeholder="请选择"
          >
            <el-option
              v-for="(item,index) in xqList"
              :key="index"
              :label="item.xqmc"
              :value="item.xqmc"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>批次：</span>
          <el-select
            v-model="planname"
            style="width: 90px"
            size="mini"
            clearable
            placeholder="请选择"
          >
            <el-option
              v-for="item in selectPcList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>考试类型：</span>
          <el-select
            v-model="xxlx"
            style="width: 90px"
            size="mini"
            clearable
            placeholder="请选择"
          >
            <el-option
              v-for="item in xxlxList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>级次：</span>
          <el-select
              v-model="studentlevel" size="mini"
              placeholder="请选择级次"
              style="width:140px"
              clearable
            >
              <el-option
                v-for="(item,index) in njList"
                :key="index"
                :label="item.xqszxn"
                :value="item.xqszxn"
              >
              </el-option>
            </el-select>
        </div>
        <div class="search-container-item">
          <span>专业班次：</span>
          <el-select
            v-model="specialtyclassname" size="mini"
            placeholder="请选择专业班次"
            style="width:140px"
            clearable
          >
            <el-option
              v-for="(item) in specialtyList"
              :key="item.id"
              :label="item.className"
              :value="item.id"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>课程名称：</span>
          <el-input
            style="width: 152px"
            size="mini"
            placeholder="请输入内容"
            v-model="course"
            clearable
          ></el-input>
        </div>
        <div class="search-container-item">
          <span>状态：</span>
          <el-select
              v-model="examcoucheckstatus" 
              size="mini"
              placeholder="请选择状态"
              style="width:180px"
              value-key="value"
              clearable
              multiple
              collapse-tags
            >
              <el-option
                v-for="item in statusList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
        </div>
        <div class="search-button" @click="queryTeaCoursePlanList">
          <img src="../../../assets/assessment/icon-search.png" alt=""/>
          <span>查询</span>
        </div>
      </div>
      <div class="search-container-right">
        <div class="export-buttons" style="width:160px" @click="toEditPlanssa()">
          <span style="font-size:14px;color:rgb(82, 48, 233)">监考申请记录</span>
        </div>
        <div class="export-button" @click="toEditPlanss()">
          <img src="../../../assets/workload/testbule.png" alt=""/>
          <span style="font-size:14px;color:rgb(248, 105, 0)">查看全部考试安排</span>
        </div>
        <div class="add-button" @click="toChangeRecord()">
          <img src="../../../assets/workload/testyellow.png" alt=""/>
          <span style="font-size:14px;color:rgb(243 184 21)">查看全部缓考安排</span>
        </div>
      </div>
    </div>
    <div class="table-container">
      <div class="table-header">

        <div class="item kcbh">
          <span>状态</span>
        </div>
        <div class="item pycc">日期</div>
        <div class="item xxlx">节次</div>
        <div class="item skjy">系</div>
        <div class="item nj">教研室</div>
        <div class="item jxb">考试课程</div>
        <div class="item zybc">授课教员</div>
        <div class="item jxbrs">考试类型</div>
        <div class="item zrs">考试方式</div>
        <div class="item fz">队别</div>
        <div class="item jc">级次</div>
        <div class="item kxzy">专业班次</div>
        <div class="item ktcp">人数</div>
        <div class="item qzks">考场</div>
        <div class="item kzkh">监考员</div>
        <div class="item ypfj">备注</div>
      </div>
      <div class="table-body" v-for="(item, index) in tableData" :key="index">

        <div class="item kcbh">

          <div class="x-context" v-show="item.examcoucheckstatus" v-if="+item.examcoucheckstatus === 3">待教研室审批</div>
          <div class="x-context" v-show="item.examcoucheckstatus" v-if="+item.examcoucheckstatus === 5">已发布</div>
        </div>
        <div class="item right-content">
          <div class="right-content-info">
            <div class="item pycc">{{ item.exadate }}</div>
            <div class="item xxlx">{{ item.exaschedule }}</div>
            <div class="item skjy">{{ item.department }}</div>
            <div class="item nj">{{ item.teachingandresearchsection }}</div>
            <div class="item jxb">{{ item.coursename }}</div>
            <div class="item zybc">{{ item.teachingfaculty }}*</div>
            <div class="item jxbrs">{{ item.checktype }}</div>
            <div class="item zrs">{{ item.finalexamination }}</div>
            <div class="item fz">
              <div class="item fza" v-for="(fz,index ) in item.studentteamList" :key="index">{{ fz }}</div>
            </div>
            <div class="item jc">
              <div class="item fza" v-for="(fz,index ) in item.studentlevelList" :key="index">{{ fz }}</div>
            </div>
            <div class="item kxzy">
              <div class="item fza" v-for="(fz,index ) in item.specialtyclassnameList" :key="index">{{ fz }}</div>
            </div>
            <div class="item ktcp">
              <div class="item fza" v-for="(fz,index ) in item.biggernumberList" :key="index">{{ fz }}</div>
            </div>
            <div class="item qzks">
              <div class="item fza" v-for="(fz,index ) in item.exasiteList" :key="index">{{ fz }}</div>
            </div>
            <div class="item kzkh">
              <div class="item fza" v-for="(fz,index ) in item.exateaidList" :key="index">
                <!-- <div class="fzaa" > -->
                  <!-- v-show="+item.examcoucheckstatus === 5" -->
                  <!-- <span> {{ fz }}</span>
                  <div class="cz-save" @click="addSaveApply(item.examplancalssVOS[index].id)">申请调整监考</div> -->
                  <!-- <div class="cz-save" @click="addSaveApply(item.kcId)" v-show="item.examcoucheckstatus" v-if="+fz === ''">更改</div> -->
                <!-- </div> -->
                <div class="fzaa">
                  <!-- v-if="+item.examcoucheckstatus === 5" -->
                  <div v-if="fz">
                    <span>{{ fz }}</span>
                    <div class="cz-save" @click="addSaveApply(item.examplancalssVOS[index].id)">申请调整监考</div>
                    <div class="cz-change" style="margin-top:5px"  @click="updateJiankao(item.examplancalssVOS[index].id)">更改</div>
                  </div>
                  <div class="cz-edit"  v-else>
                    <span @click="systemJianKao(item.examplancalssVOS[index].id)">设置监考员</span>
                  </div>
                </div>
              </div>
            </div>
            <div class="item ypfj">
              <div class="item fza" v-for="(fz,index ) in item.paramvalueList" :key="index"
                   @click="selectClassId(item.examplancalssVOS[index].id)">
                {{ fz }}
              </div>
            </div>
          </div>
          <div class="spjd">
            <div class="spjd-title">排考进度：</div>
            <div class="time-line-horizon">
              <div class="time-line-block" v-for="(block, index1) in item.examplanchecks" :key="index1">
                <div class="person-name">{{ block.checkuser }}</div>
                <div class="line-content">
                  <img src="../../../assets/assessment/icon-finish.png" alt="已审批" v-if="+block.chstatus === 3"/>
                  <img src="../../../assets/assessment/icon-dai.png" alt="待审批" v-if="+block.chstatus === 2"/>
                  <img src="../../../assets/assessment/icon-close.png" alt="未审批" v-if="+block.chstatus === 1"/>
                  <div class="date-time">
                    <span class="date">{{ block.checktime }}</span>
                    <span class="time">{{ block.chenckdate }}</span>
                  </div>
                </div>
                <div class="operate" v-show="block.checkremark" v-if="index1===0">
                  <div class="ly-block" @click="showAddMessageDialog = true">
                    <img src="../../../assets/assessment/icon-ly.png" alt=""/>
                    <div class="ly">留言</div>
                  </div>
                </div>
                <div class="operate" v-show="block.checkremark" v-if="index1!==0">
                  <div class="bubble-block">
                    <span>{{ block.checkremark }}</span>
                    <div class="operate-button">
                      <div
                        class="button-bj"
                        @click="textUpdate(block.checkid,block.checkremark)"
                        v-show="block.checkremark" v-if="index1!==0"
                      >
                        编辑
                      </div>
                      <div
                        @click="textDelete(block.checkid)"
                        class="button-sc"
                        v-show="block.checkremark" v-if="index1!==0"
                      >
                        删除
                      </div>
                    </div>
                  </div>
                </div>
                <el-dialog
                  title="添加留言"
                  :visible.sync="showAddMessageDialog"
                  width="983px"
                >
                  <div class="message-container">
                    <div>添加留言：</div>
                    <div>
                      <el-input
                        v-model="text"
                        type="textarea"
                        :rows="8"
                        style="width: 550px"
                      ></el-input>
                    </div>
                  </div>
                  <span slot="footer" class="dialog-footer">
                    <button class="green" @click="addText(block.checkid,text)">
                      确 定
                    </button>
                  </span>
                </el-dialog>
                <el-dialog
                  title="编辑留言"
                  :visible.sync="showbjMessageDialog"
                  width="983px"
                >
                  <div class="message-container">
                    <div>编辑留言：</div>
                    <div>
                      <el-input
                        v-model="text"
                        type="textarea"
                        :rows="8"
                        style="width: 550px"
                      ></el-input>
                    </div>
                  </div>
                  <span slot="footer" class="dialog-footer">
<!--                      showbjMessageDialog = false-->
                    <button class="green" @click="update(pid,text)">
                      确 定
                    </button>
                  </span>
                </el-dialog>
                <el-dialog
                  title="查看留言"
                  :visible.sync="showckMessageDialog"
                  width="983px"
                >
                  <div class="message-container">
                    <div>查看留言：</div>
                    <div>
                      <!--                        v-model="block.bjmeaasgeText"-->
                      <el-input
                        v-model="text"
                        type="textarea"
                        :rows="8"
                        style="width: 550px"
                        disabled="false"
                      ></el-input>
                    </div>
                  </div>
                  <span slot="footer" class="dialog-footer">
                    <button class="green" @click="showckMessageDialog = false">
                      确 定
                    </button>
                  </span>
                </el-dialog>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="bottom-block">
      <div class="export-button">
        <img src="../../../assets/assessment/icon-export.png" alt=""/>
        <span>导出Excel</span>
      </div>
      <div class="text">授课教员名字后加“*”为课程负责人</div>
    </div>

    <el-dialog title="备注" :visible.sync="showAddMessageRemark" width="983px">
      <div class="message-container">
        <div>填写备注：</div>
        <div>
          <el-input
            v-model="meaasgeText"
            type="textarea"
            :rows="8"
            style="width: 550px"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <button class="green" @click="editRe">
          确 定
        </button>
      </span>
    </el-dialog>

    <el-dialog title="申请调整监考" :visible.sync="showYprDialogs" width="983px" style="height:832px" class="szjky">
      <div class="assessment-edit-plan-container">
        <div class="my-form-container" style="width:100%;height:350px" :model="form">
          <el-row class="my-form-item" style="height: 50%;">
            <el-col>
              <div class="my-form-item-label">调整事由</div>
              <div class="my-form-item-value assessment-design">
                <el-input v-model="form.applyreason" type="textarea" :rows="6" style=" width: 625px;
                  margin-top: 17px;  margin-left: -20px;" placeholder="请输入内容"></el-input>
              </div>
            </el-col>
          </el-row>
          <el-row class="my-form-item" style="height: 50%;">
            <el-col>
              <div class="my-form-item-label">新监考员</div>
              <div class="my-form-item-value" style="margin-top:70px; height: 100px;" @click="showYprDial(1)">
                <img src="../../../assets/home/grena-anniu.png" alt=""/>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
          <img
            @click="saveApply"
            class="del-icon"
            src="../../../assets/home/yellow-commint.png"
            alt=""
          />
      </span>
    </el-dialog>
    <el-dialog :title="选择监考员" :visible.sync="showYprDialog" width="983px">
      <div class="choose-ypr-container">
        <div class="choose-ypr-search-container">
          <span class="title">单位：</span>
          <el-select
            v-model="dw"
            style="width: 100px; margin-right: 30px"
            size="mini"
            placeholder="请选择"
          >
            <el-option
              v-for="item in dwList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-input
            style="width: 152px; margin-right: 20px"
            size="mini"
            v-model="courseYpr"
            placeholder="关键字搜索"
          >
            <i slot="prefix" class="el-input__icon el-icon-search"></i>
          </el-input>
          <div class="search-button">
            <img src="../../../assets/assessment/icon-search.png" alt=""/>
            <span @click="showYprClick">查询</span>
          </div>
          <div class="button-list">
            <div
              class="button-item"
              v-for="(item, index) in searchNameList"
              :key="index"
              @click="delTag(index)"
            >
              <img
                class="del-icon"
                src="../../../assets/assessment/approval-del.png"
                alt=""
              />
              <div>{{ item }}</div>
            </div>
          </div>
        </div>
        <div class="choose-ypr-table-container">
          <el-table
            ref="multipleTable"
            :data="yjnameList"
            border
            style="width: 100%"
            class="table-data"
            row-class-name="row-class"
            cell-class-name="cell-class"
            header-row-class-name="header-row-class"
            header-cell-class-name="header-cell-class"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              prop=""
              label="选择"
              width="154"
              type="selection"
              align="center"
              class-name=""
              label-class-name=""
            >
            </el-table-column>
            <el-table-column
              prop="name"
              label="姓名"
              width="153"
              align="center"
            >
            </el-table-column>
            <el-table-column prop="sex" label="性别" width="154" align="center">
            </el-table-column>
            <el-table-column
              prop="unit"
              label="单位"
              width="153"
              align="center"
            >
            </el-table-column>
            <el-table-column prop="job" label="职务" align="center">
            </el-table-column>
          </el-table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
          <button class="green" @click="showYprDialogclosure()">确 定</button>
        </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  addApply,
  checkUpdate,
  courseTeaPlanGetList,
  editRemark, selectClassDetail,
  selectDetail
} from "../../../api/courseExame/coursePlan";
// import showYprDialog from "@/views/comonents/showYprDialog";
import {UpdateID} from "@/api/teacher/supervision";
import { reqGetXqList,reqCheckYearList,reqZybcList,reqXydList,queryDictByCode } from "@/api/admin1/check";
import {getSelectJob} from "@/api/propositionReview/approval";

export default {
  // components: {
  //   showYprDialog,
  // },
  data() {
    return {
      applyFlag:'',
      yjnameList: [],
      dw: "",
      dwList: [
        {
          value: "计算机教研室",
          label: "计算机教研室",
        },
        {
          value: "作战教研室",
          label: "作战教研室",
        },
      ],
      form: {
        examcouid: "",
        applyreason: "",
        newteaexam: ""
      },
      pid: "",
      text: "",
      design: '',
      xq: "",
      xqList: [],
      pycc: '',
      pyccList: [],
      studentlevel:'',
      njList:[],
      specialtyclassname:'',
      specialtyList:[],
      examcoucheckstatus:'',
      statusList: [
        {
          value: "1",
          label: "未排考"
        },
        {
          value: "2",
          label: "待下发核对"
        },
        {
          value: "6",
          label: "待教员审核"
        },
        {
          value: "3",
          label: "待教研主任审核"
        },
        {
          value: "4",
          label: "待发布"
        },
        {
          value: "5",
          label: "已发布"
        }
      ],
      xxlx: undefined,
      xxlxList: [
        {
          value: "补考",
          label: "补考",
        },
        {
          value: "缓考",
          label: "缓考",
        },
      ],
      zt: undefined,
      checkedStatus: false,
      searchNameList: [],
      tableData: [],
      yprList: [
        {
          id: 1,
          name: "张三丰",
          sex: "女",
          company: "单位一部",
          position: "教员",
        },
        {
          id: 2,
          name: "张三丰",
          sex: "女",
          company: "单位一部",
          position: "教员",
        },
        {
          id: 2,
          name: "张三丰",
          sex: "女",
          company: "单位一部",
          position: "教员",
        },
        {
          id: 2,
          name: "张三丰",
          sex: "女",
          company: "单位一部",
          position: "教员",
        },
        {
          id: 2,
          name: "张三丰",
          sex: "女",
          company: "单位一部",
          position: "教员",
        },
      ],
      courseYpr: "",
      showYprDialog: false,
      showYprDialogs: false,
      showAddMessageDialogly: false,
      showAddMessageDialoglys: false,
      //添加留言
      showAddMessageDialog: false,
      //编辑留言
      showbjMessageDialog: false,
      //查看留言
      showckMessageDialog: false,
      //添加备注
      showAddMessageRemark: false,
      classId: "",
      className: "",
      meaasgeText: "",
      course: "",
      handleSelection: [],
      // dialogTitle: '选择教员'
    };
  },
  created() {
    this.queryTeaCoursePlanList();
  },
  mounted(){
    this.termAll();
    this.gradeAll();
    this.getlist();
  },
  methods: {
    //初始化的监考员表格信息
    showYprClick() {
      let obj = {
        unit: this.dw,
        name: this.courseYpr
      }
      return new Promise(() => {
        getSelectJob(obj).then(res => {
          this.yjnameList = res.data.data;
        })
      })
    },
    getSelectJob: function (rows) {
      let obj = {rows}
      let el = this
      return new Promise(() => {
        getSelectJob(obj).then(res => {
          this.yjnameList = res.data.data
          el.$nextTick(() => {
            rows.forEach(row => {
              el.$refs.multipleTable.toggleRowSelection(
                el.yjnameList.find(item => {
                    return row == item.id;
                  }
                ), true);
            });
          })
        })
      })
    },
    //设置监考员选择框
    handleSelectionChange(val) {
      this.handleSelection.splice(0, this.handleSelection.length);
      this.searchNameList.splice(0, this.searchNameList.length);
      this.handleSelection = val
      for (const valKey in val) {
        this.searchNameList[valKey] = val[valKey].name
      }
    },
    //学期
    async termAll() {
      const result = await reqGetXqList();
      if (result.data.code == 200) {
        this.xqList = result.data.data;
      }
    },
    //获取年级
    gradeAll(){
      let that = this;
      reqCheckYearList().then(res => {
        if(res.data.code == 200 && res.data.data){
          that.njList = res.data.data;
        }
      });
    },
    //获取专业班次
    async getlist(){
      const result = await reqZybcList();
      result.data.code == 200 ? this.specialtyList = result.data.data : [];
    }, 
    //点击选择监考员
    //教员评教信息核对(查询)EditUpdate(item.evalactorid)
    // showYprDialClick: function (teacherid) {
    //   this.showYprDialog = teacherid
    // },
    //点修改完成页面参评对象的修改
    //点击新监考员选择
    showYprDial(teacherid,evalactorid){
      this.showYprDialog = true;
      this.showYprDialogs = false;
      // this.evalactorid=evalactorid
      // this.dialogTitle='选择监考员'
      // this.showYprDialClick(teacherid);
    },
    //更新
    renew: function (id,name) {
      let obj={
        evalactorid: this.evalactorid,
        teacherid : id,
        teachername : name
      }
      //修改传值
      return new Promise(() => {
        //网上评教修改保存
        UpdateID(obj).then(res => {
          this.pjevalactor();
        })
        console.log('renew', id, name)
      })
    },
    queryTeaCoursePlanList() {
      let obj = {
        termid: this.xq,
        planname: this.pycc,
        checktype: this.xxlx,
        studentlevel: this.jc,
        specialtyclassname: this.zybc,
        coursename: this.course,
        examcoucheckstatus: this.zt,
      };
      courseTeaPlanGetList(obj).then(res => {
        this.tableData = res.data.data;
        let data = res.data.data;
        if(this.tableData.length > 0){
          for (let i = 0; i < this.tableData.length; i++) {
            this.tableData[i].studentteamList = []
              this.tableData[i].studentlevelList = []
              this.tableData[i].specialtyclassnameList = []
              this.tableData[i].biggernumberList = []
              this.tableData[i].exasiteList = []
              this.tableData[i].exateaidList = []
              this.tableData[i].paramvalueList = []
              // console.log(this.tableData[i].examplancalssVOS)
            for (let j = 0; j < this.tableData[i].examplancalssVOS.length; j++) {
              // console.log(data[0].examplancalssVOS[0].studentteam)
              this.tableData[i].studentteamList.push(data[i].examplancalssVOS[j].studentteam)
              this.tableData[i].studentlevelList.push(data[i].examplancalssVOS[j].studentlevel)
              this.tableData[i].specialtyclassnameList.push(data[i].examplancalssVOS[j].specialtyclassname)
              this.tableData[i].biggernumberList.push(data[i].examplancalssVOS[j].biggernumber)
              this.tableData[i].exasiteList.push(data[i].examplancalssVOS[j].exasite)
              this.tableData[i].exateaidList.push(data[i].examplancalssVOS[j].exaterid)
              console.log(this.tableData[i].exateaidList)
              this.tableData[i].paramvalueList.push(data[i].examplancalssVOS[j].paramsort)
            }
          }
        }
      })
    },
    systemJianKao(zId){
      // this.showYprDialClick(1,2);
      this.classId = zId;
      this.className = this.from.newteaexam;
      console.log("zId"+zId);
      this.sysJianKao();
      this.queryTeaCoursePlanList();
    },
    sysJianKao(){
      let obj = {
        id: this.classId,
        exaterid: this.className,
      }
      editRemark(obj).then(res =>{
        this.$message({
          type: 'success',
          message: '操作成功'
        })
      })
    },
    //表格点击选择监考员框弹出
    updateJiankao(zId,fz){
      this.applyFlag = 'edit';
      this.showYprDialog = true;
      // this.showYprDialClick(fz);
      this.classId = zId;
      // this.className = this.from.newteaexam;
      this.sysJianKao();
      this.queryTeaCoursePlanList();
    },
    // showYprDialClick: function (row) {
    //   this.showYprDialog = row
    //   console.log(this.showYprDialog)
    // },
    // renew: function (val) {
    //   this.form.newteaexam = val;
    // },
    //备注
    selectClassId(cid) {
      this.classId = cid;
      console.log(this.classId)
      let obj = {
        id:cid,
      }
      selectClassDetail(obj).then(res =>{
        this.meaasgeText = res.data.data.paramsort;
      })
      this.showAddMessageRemark = true;
    },
    editRe() {
      let obj = {
        id: this.classId,
        paramsort: this.meaasgeText
      }
      console.log(obj)
      editRemark(obj).then(res =>{
        this.$message({
          type: 'success',
          message: '操作成功'
        })
      })
      this.showAddMessageRemark = false;
      this.queryTeaCoursePlanList();
    },
    queryCouId(row) {
      this.form.examcouid = row.id;
    },
    addApply() {
      add(this.form).then(res => {
        this.showYprDialogs = false;
      })
    },
    //申请调整监考
    addSaveApply(classId) {
      this.showYprDialogs = true;
      this.showYprDialog = false;
      this.form.examcouid = classId;
    },
    //选择监考员点击确定
    showYprDialogclosure() {
      this.showYprDialog = false;
      this.applyFlag = 'edit' ? this.showYprDialogs = false : this.showYprDialogs = true;
      let arr = [];
      for (const Key in this.handleSelection) {
        arr[Key] = this.handleSelection[Key].id
      }
      let str = arr.join(",");
      // this.form.newteaexam = str;
    },
    saveApply() {
      console.log(this.form);
      addApply(this.form).then(res => {
        this.$message({
          type: 'success',
          message: '申请成功'
        })
      })
    },
    textSelect(cId) {
      console.log("id", cId);
      selectDetail(cId).then(res => {
        this.text = res.data.data.checkremark;
      })
      this.showckMessageDialog = true;
    },
    textUpdate(cId) {
      selectDetail(cId).then(res => {
        this.text = res.data.data.checkremark;
      });
      this.pid = cId;
      this.showbjMessageDialog = true;
      this.queryExaApplyList();
    },
    textDelete(ids) {
      let obj = {
        id: ids,
        checkremark: " ",
      }
      this.$confirm('确认要删除吗？')
          .then(_ => {
            checkUpdate(obj).then(res => {
              if(res.data.code == 200){
                this.$message({
                  showClose: true,
                  message: '删除成功',
                  type: 'success'
                });
                this.showbjMessageDialog = false;
                this.queryExaApplyList();
              }
            })
          })
    },
    update() {
      let obj = {
        checkid: ids,
        checkremark: " ",
      }
      this.showbjsagMeseDialog = false;
      checkUpdate(obj).then(res => {
        this.$message({
          showClose: true,
          message: '操作成功',
          type: 'success'
        });
      })
      this.queryExaApplyList();
    },
    addText(tid, tex) {
      this.showAddMessageDialog = false;
      this.update(tid, tex);
      console.log("tid" + tid);
    },
    sss() {
      this.showYprDialogs = false
      this.showYprDialog = true
    },
    toEditPlanss() {
      this.$router.push("/teacher/examination/examination");
    },
    toEditPlanssa() {
      this.$router.push("/teacher/workload/AdjustInvigilators");
    },
    delTag(index) {
      let el = this
      console.log(this.$refs.multipleTable, 'multipleTable')
      // this.$refs.multipleTable.clearSelection(this.searchNameList[index]);
      this.searchNameList.splice(index, 1);
      el.$nextTick(() => {
        el.$refs.multipleTable.toggleRowSelection(
          el.yjnameList.find(item => {
              return this.handleSelection[index].id == item.id;
            }
          ), false);
      })
    },
    checkAll() {
      this.tableData = this.tableData.map((item) => {
        return {...item, checked: this.checkedStatus};
      });
    },
    itemChange() {
      this.checkedStatus = this.tableData.every((item) => item.checked);
    },
    toChangeRecord() {
      this.$router.push("/teacher/workload/arrangement");
    },
    toEditPlan() {
      // this.$router.push("/teacher/assessment/editPlan");
    },
    toChangePlan() {
      // this.$router.push("/teacher/assessment/changePlan");
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.el-select__tags {
  min-width: 160px;
}
.choose-ypr-container {

  width: 767px;
  margin: 0px auto;

  .choose-ypr-search-container {
    .el-input--prefix .el-input__inner {
      padding-left: 30px;

    }

    .el-input__inner {
      &::placeholder {
        color: #b8b8b8;

      }

      &::-webkit-input-placeholder {
        /* WebKit browsers 适配谷歌 */
        color: #b8b8b8;
      }

      &:-moz-placeholder {
        /* Mozilla Firefox 4 to 18 适配火狐 */
        color: #b8b8b8;
      }

      &::-moz-placeholder {
        /* Mozilla Firefox 19+ 适配火狐 */
        color: #b8b8b8;
      }

      &:-ms-input-placeholder {
        /* Internet Explorer 10+  适配ie*/
        color: #b8b8b8;
      }
    }

    display: flex;
    flex-direction: row;
    align-items: center;

    .title {
      font-size: 18px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      line-height: 20px;
      color: #004ca7;
      margin-right: 5px;
    }

    .search-button {
      width: 77px;
      height: 28px;
      line-height: 28px;
      background: #f1f8fe;
      border: 1px solid #51aef6;
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;

      > span {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #51aef6;
      }

      > img {
        width: 20px;
        height: 20px;
        margin-right: 4px;
      }
    }

    .button-list {
      display: flex;
      flex-direction: row;
      align-items: center;
      margin-left: 21px;

      .button-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 69px;
        height: 27px;
        line-height: 27px;
        border: 1px solid #004ca7;
        border-radius: 4px;
        margin-right: 10px;
        text-align: center;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #004ca7;

        .del-icon {
          position: absolute;
          right: 0px;
          top: 0px;
          width: 12px;
          height: 12px;
          padding: 2px;
        }
      }
    }
  }

  .choose-ypr-table-container {
    margin-top: 15px;

    .el-table td,
    .el-table th.is-leaf,
    .el-table--border,
    .el-table--group {
      border-color: #c7d7eb;
    }

    .el-table__header tr,
    .el-table__header th {
      padding: 0;
      height: 57px;
      background-color: #edf2f9;
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      line-height: 20px;
      color: #004ca7;
    }

    .el-table__body tr,
    .el-table__body td {
      padding: 0;
      height: 51px;
    }

    .table-data {
      width: 100%;
      border: 0.8px solid #004ca7;
      border-radius: 9px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #004ca7;
    }


  }
}


</style>
<style lang="less" scoped>
@import "../../../styles/teachHome.less";

/deep/ .szjky .el-dialog__body {
  height: 432px;
}

.pagination-block {
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.message-container {
  > div {
    display: inline-block;

    &:nth-child(1) {
      padding-left: 111px;
      font-size: 20px;
      color: rgba(0, 76, 167, 1);
      font-weight: bold;
      vertical-align: top;
    }

    &:nth-child(2) {
    }
  }
}
</style>
